//
//  AKPMessageListTableViewCell.m
//  Copy_AiKapPu_Personal_OC
//
//  Created by taojianz on 2017/7/13.
//  Copyright © 2017年 taojianz. All rights reserved.
//

#import "AKPMessageListTableViewCell.h"
#import "AKPMessageListCellButton.h"

@interface AKPMessageListTableViewCell()


@end

@implementation AKPMessageListTableViewCell


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]){
        [self setupUI];
    }
    return self;
}
-(void)setFrame:(CGRect)frame{
    [super setFrame:frame];
    [_cellButton setFrame:CGRectMake(8, 25, self.bounds.size.width-16, self.bounds.size.height - 20)];
    
}
// MARK: 关闭点击cell高亮
-(void)setSelected:(BOOL)selected animated:(BOOL)animated{

}
-(void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated{
    // 点击cell ， 设置cellButton高亮
    [_cellButton setHighlighted:highlighted];
}

-(void)setupUI{
//    // 关闭cellButton的手势接收
//    [self.cellButton setUserInteractionEnabled:false];
    
    self.backgroundColor = [UIColor groupTableViewBackgroundColor];
    
    _dateLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 3, [[UIScreen mainScreen] bounds].size.width, 20)];
    _dateLabel.text = @"2017-7-8";
    _dateLabel.textAlignment = NSTextAlignmentCenter;
    _dateLabel.font = [UIFont systemFontOfSize:13];
    _dateLabel.textColor = [UIColor darkGrayColor];
    
    [self addSubview:_dateLabel];
    
    _cellButton = [[AKPMessageListCellButton alloc]initWithFrame:CGRectMake(8, 25, self.bounds.size.width-16, self.bounds.size.height - 20)];
    
    [self addSubview:_cellButton];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
//
//- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
//    [super setSelected:selected animated:animated];
//
//    
//}

@end
